
import request from '@/utils/request';

export function listData(query) {
  return request({
    url: `/gift/list`,
    method: 'post',
    data: query
  });
}

export function saveData(form) {
  return request({
    url: '/gift/add',
    method: 'post',
    data: form
  });
}

export function updateData(form) {
  return request({
    url: '/gift/save',
    method: 'post',
    data: form
  });
}

export function deleteData(query) {
  return request({
    url: '/gift/del',
    method: 'post',
    data: query
  });
}

export function upDowmData(query) {
  return request({
    url: '/gift/up_or_down',
    method: 'post',
    data: query
  });
}

export function typeList(query) {
  return request({
    url: '/gift_type/list',
    method: 'post',
    data: query
  });
}

/*
* 礼物签到 接口
* 2021.2.26 14:20
* By Gluttony
* */

export function getGiftSignInList() {
  return request({
    url: '/signin/list',
    method: 'get'
  })
}

// 礼物签到修改保存接口
export function toSigninSave({id, days, type, prop_id, number}) {
  /*
  * id, 签到天数id
  * days: 签到的具体天数
  * type: 道具 or 道具包类型， （1： 道具包， 2： 道具）
  * prop_id : 道具 or 道具包的id
  * number : 道具 or 道具包的数量
  * */
  return request({
    url: '/signin/save',
    method: 'post',
    data: {
      id, days, type, prop_id, number
    }
  })
}
